﻿using MediatR;
using RBAC.MaHaiBo.API.Application.Command.PlotInfoCommand;
using RBAC.MaHaiBo.Entity.Traceability;
using RBAC.MaHaiBo.Service.TraceabilityService;

namespace RBAC.MaHaiBo.API.Application.CommandHandlers.PlotInfoHandler
{
    public class AccessoriesPlotInfolistCommandHandler : IRequestHandler<AccessoriesPlotInfolistCommand, List<PlotInfo>>
    {
        /// <summary>
        /// 图片服务层
        /// </summary>
        IPlotInfoService PlotInfoS;
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="PlotInfoS">图片服务层</param>
        public AccessoriesPlotInfolistCommandHandler(IPlotInfoService PlotInfoS)
        {
            this.PlotInfoS = PlotInfoS;
        }

        public async Task<List<PlotInfo>> Handle(AccessoriesPlotInfolistCommand request, CancellationToken cancellationToken)
        {
            return await PlotInfoS.AccessoriesPlotInfolist(request.Accessoriesid, request.lot);
        }
    }
}
